package edu.friday.service.impl;

import edu.friday.common.result.TableDataInfo;
import edu.friday.model.Goods;
import edu.friday.repository.GoodsRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

@Service
public class GoodsService implements edu.friday.service.GoodsService{
    @Autowired
    GoodsRepository goodsRepository;
    @Override
    public TableDataInfo selectGoodsList(Goods goods, Pageable page) {
        Page<Goods> rs = goodsRepository.findAll(page);
        return TableDataInfo.success(rs.toList(),rs.getTotalElements());
    }
}
